#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<stdlib.h>


int main()
{
   pid_t id = fork();
   if(id == 0)
   {
    int cnt = 50;
    while(cnt)
    {
      printf("i am a child   ppid: %d ,pid: %d\n",getppid(),getpid());
      sleep(1);
      cnt--;
    }

    exit(0);

   }

  //father
  int cnt = 5;

  while(cnt)
  {
      printf("i am a father  ppid: %d ,pid: %d\n",getppid(),getpid());
      sleep(1);
      cnt--;
  }

 // wait(NULL);
 // printf("father wait child done...\n");
  sleep(5);
  return 0;
}
